#pragma once

#include "stdafx.h"
#include <cv.h>
#include <cxcore.h>
#include <highgui.h>
#include <stdio.h>
#include <math.h>
#include <fstream>

#include "ImageStitcher.h"
#include "ResourceLibrary.h"
#include "ImageMethods.h"

using namespace cv;
using namespace std;

class PatchFinder
{
public:

	ImageStitcher* stitcher;
	ResourceLibrary* resources;
	ImageMethods* im;

	vector< Point2f > roi;
	vector<int> validPatches;

	PatchFinder(ResourceLibrary* rl, ImageStitcher* is);							//Constructor
	~PatchFinder(void);

	//-- Retrieval Functions
	vector<int> PatchFinder::findValidPatches();
	int PatchFinder::pointInPoly(vector<Point2f> c, Point2f p);

	//-- Selection Functions
	void PatchFinder::defineROI(Point start, int width, int height);
	void PatchFinder::defineROI(vector<Point2f> points);

	//-- Display Functions
	void PatchFinder::displayWarpedImages();
	void PatchFinder::displayWarpedImagesROI();
	void PatchFinder::displayValidPatches();

	//-- Storage Functions
	void PatchFinder::savePatches();
	
};
